package org.springframework.session.data.redis.config.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.session.data.redis.ReactiveRedisSessionRepository;
import org.springframework.session.data.redis.RedisIndexedSessionRepository;
import org.springframework.session.data.redis.RedisSessionRepository;

/**
 * Annotation used to inject the Redis accessor used by Spring Session's Redis session
 * repository.
 *
 * @author Vedran Pavic
 * @see RedisIndexedSessionRepository#getSessionRedisOperations()
 * @see RedisSessionRepository#getSessionRedisOperations()
 * @see ReactiveRedisSessionRepository#getSessionRedisOperations()
 * @since 2.0.0
 */
@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Value("#{sessionRepository.sessionRedisOperations}")
public @interface SpringSessionRedisOperations {

}
